package impl

import (
	"gitee.com/liuxiaowei123/vblog-01/vblog-01/vblog/blog"
	"gitee.com/liuxiaowei123/vblog-01/vblog-01/vblog/conf"
	"gitee.com/liuxiaowei123/vblog-01/vblog-01/vblog/ioc"
	"gorm.io/gorm"
)

// 此文件，用于实现blog对象的ioc托管

// 约束实现接口的对象
var _ blog.Service = &blogServiceImpl{}

type blogServiceImpl struct {
	db *gorm.DB
}

func init() {
	ioc.Controller().Registry(&blogServiceImpl{})
}

func (b *blogServiceImpl) Init() {
	b.db = conf.C.Mysql.Getconn().Debug()
}

func (b *blogServiceImpl) Name() string {
	return blog.Appname
}
